import React from 'react';
import Home from './pages/Home'
import About from "./pages/About";
import {Route, Routes,NavLink,Navigate} from "react-router-dom";

function App(props) {
    return (
        <div>
            <div className="row">
                <div className="col-xs-offset-2 col-xs-8">
                    <div className="page-header"><h2>React Router Demo</h2></div>
                </div>
            </div>
            <div className="row">
                <div className="col-xs-2 col-xs-offset-2">
                    <div className="list-group">
                        <NavLink to="/about" className="list-group-item " >About</NavLink>
                        <NavLink to="/home" className="list-group-item" >Home</NavLink>
                    </div>
                </div>
                <Routes>
                    <Route path='/about' element={<About></About>}></Route>
                    <Route path='/home' element={<Home></Home>}></Route>
                    <Route path='/' element={<Navigate to='/about'/>} ></Route>
                </Routes>
            </div>
        </div>
    );
}

export default App;